#include <stdio.h>
int main()
{
    printf("请输入要输入几位数字：\n");
    int n, i, j;
    scanf("%d", &n);
    int a[n];
    printf("请输入需要输入的数字：\n");
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    int amin, amax;
    amin = a[0], amax = a[0];
    for (i = 0; i < n; i++)
    {
        if (a[i] < amin)
        {
            amin = a[i];
        }
        if (a[i] > amax)
        {
            amax = a[i];
        }
    }
    int sum=amax+amin;
    printf("大%d,小%d,和为%d\n", amax, amin,sum);
    return 0;
}